package net.e4net.watrix.example.action.hello;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.e4net.watrix.ActionResponse;
import net.e4net.watrix.ResponseData;
import net.e4net.watrix.WatrixContext;
import net.e4net.watrix.WatrixException;
import net.e4net.watrix.common.hao.RequestParser;
import net.e4net.watrix.runtime.AbstractAction;

public class HelloActn extends AbstractAction {

    public ActionResponse execute(WatrixContext context,
            HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException, WatrixException {

        RequestParser parser = context.getRequestParser("default",request,response);
        String user_nm = parser.getParameter("user_nm","");
        String page_no = parser.getParameter("page_no","1");

        ResponseData resData = super.getResponseData(request);
        resData.put("user_nm", user_nm);
        resData.put("page_no", page_no);

        return super.getActionResponse(context);
    }
}